trichview.com

trichview.support




Re: [FOLLOW] was : fastest way to use trichview


Return to index


Author

Message

Sergey Tkachenko

Posted: 11/26/2004 22:17:02


I can give you a suggestion.


Delphi bitmaps can share graphics.


Compare two examples:


1)

var bmp1, bmp2: Integer;


bmp1 := TBitmap.Create;

bmp2 := TBitmap.Create;

bmp1.LoadFromFile('image.bmp');

bmp2.LoadFromFile('image.bmp');

rv.AddPictureEx('', bmp1, 0, rvvaBaseLine);

rv.AddPictureEx('', bmp2, 0, rvvaBaseLine);


and


2)

var bmp1, bmp2: Integer;


bmp1 := TBitmap.Create;

bmp2 := TBitmap.Create;

bmp1.LoadFromFile('image.bmp');

bmp2.Assign(bmp1);

rv.AddPictureEx('', bmp1, 0, rvvaBaseLine);

rv.AddPictureEx('', bmp2, 0, rvvaBaseLine);


Results of these examples look the same, but they are not equivalent.

In the first example, there are two copies of the same graphic in memory fo

bmp1 and bmp2 .

In the second example, bmp1 and bmp2 share the same graphic.

If you know this, you can use this knowledge to reduce resource usage in

your application.

Load the first instance of image, and copy it using Assign for other

instances.


>

> Hi

>

> i have write a (late) reply to this post ... continue discussion here or

> delete this post

>

> thanks :)





Powered by ABC Amber Outlook Express Converter